package cn.cangfei.massage.mapper;

import cn.cangfei.massage.entity.VisitAppointment;
import cn.cangfei.massage.entity.VisitAppointmentExample;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface VisitAppointmentMapper extends BaseMapper<VisitAppointment> {
    long countByExample(VisitAppointmentExample example);

    int deleteByExample(VisitAppointmentExample example);

    int deleteByPrimaryKey(Long id);

//    int insert(VisitAppointment record);

//    int insertSelective(VisitAppointment record);

    List<VisitAppointment> selectByExample(VisitAppointmentExample example);

    VisitAppointment selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") VisitAppointment record, @Param("example") VisitAppointmentExample example);

    int updateByExample(@Param("record") VisitAppointment record, @Param("example") VisitAppointmentExample example);

    int updateByPrimaryKeySelective(VisitAppointment record);

    int updateByPrimaryKey(VisitAppointment record);

    Integer getTimePeriodByDoctorId(@Param("doctorId") Long doctorId);

    String getDayById(@Param("id") Long id);

    /**
     * 必须是今天的
     *
     * @param format
     * @return
     */
    List<VisitAppointment> getAppointmentsByDay(@Param("format") String format);

    /**
     * 得到这天预约这个师傅并且没有取消的人数
     *
     * @param format
     * @param doctorId
     * @return
     */
    List<VisitAppointment> getYuYue(@Param("format") String format, @Param("doctorId") Long doctorId);

    List<VisitAppointment> selectListByStatus(@Param("status") int status);

    List<Integer> getListTimePeriod(@Param("day") String day, @Param("doctorId") Long doctorId, @Param("massageId") Long massageId);
}
